home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
7_9.lha
/
7_9
/
7_9_prev.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
493b
|
30 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ Get the previous entry from a list,
/ moving curr backwards.
nt dlist::prev(dlink *&a)
if (!last)
return 0;
// move curr backwards, possibly to
// the beginning or end of the list.
if (curr)
if (curr == last->next)
{
curr = 0;
return 0;
}
else
curr = curr->prev;
else
curr = last;
a = curr;
return 1;